#include"mypriority_queue.h"

namespace bit
{
	void test1()
	{
		mypriority_queue<int> q;
		q.push(1);
		cout << q.top() << endl;
		q.push(2);
		cout << q.top() << endl;
		q.push(8);
		q.push(7);
		q.push(100);
		q.push(10);
		cout << q.top() << endl;

		while (!q.empty())
		{
			cout << q.top() << " ";
			q.pop();
		}
		cout << endl;
	}

	void test2()
	{
		std::vector<int> v = { 5, 10, 30, 8, 20 };
		mypriority_queue<int, vector<int>, mygreater<int>> q(v.begin(), v.end());

		while (!q.empty())
		{
			cout << q.top() << " ";
			q.pop();
		}
	}

	void test3()
	{
		int a = 2, b = 3, c = 5;
		int* p1 = &a, * p2 = &b, * p3 = &c;
		mypriority_queue<int*, vector<int*>, mygreater<int*>> v;
		v.push(p1);
		v.push(p2);
		v.push(p3);
		while (!v.empty())
		{
			cout << *(v.top()) << " ";
			v.pop();
		}

	}
}

int main()
{
	//bit::test1();
	//bit::test2();
	bit::test3();
	return 0;
}